﻿<?php
	$url = 'http://top.baidu.com/buzz?b=1';
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    $html = curl_exec($ch);
    curl_close($ch); 
    $bts = '';
    $zss = '';
    
	for($i = 0;$i < 50;$i ++)
	{
		$html = strstr($html, '<a class="list-title"');
		$html = strstr($html, '">');
		$a = strpos($html,'/a') - 1;
		$wenben = mb_substr($html , 0 , $a);
		
		$wenben = str_replace('">','',$wenben);

		$wenben = iconv("gb2312","utf-8//IGNORE",$wenben);
		$bts .= $wenben.'|Anters|';


		$html = strstr($html, '<td class="last">');
		$html = strstr($html, 'icon-');
		$html = strstr($html, '>');
		$a = strpos($html,'/span>') - 2;
		$wenben = mb_substr($html , 1 , $a);
		
		$wenben = str_replace('ise">','',$wenben);

		$wenben = iconv("gb2312","utf-8//IGNORE",$wenben);
		$zss .= $wenben.'|Anters|';

	}
	echo $bts.'|Anters_fg|'.$zss;
    exit;
?>